package com.lovo.hb.util;


import com.lovo.hb.vo.ErrorVO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(Exception.class)
    public ResponseEntity<ErrorVO> allException(Exception ex){
        ErrorVO vo=new ErrorVO();
       vo.setTag(1);
        vo.setInfo(ex.getMessage());
       return ResponseEntity.ok(vo);
    }
}
